//TicketTaker.h
#ifndef TicketTaker_H
#define TicketTaker_H

#include "line.h"
#include "list.h"
#include "synch.h"
#include <stdarg.h>
#include <string>

class TicketTaker
{
	public:
		TicketTaker(char* name, Line* line);
		~TicketTaker();
		void SendMessage(char* name, int argc, ...);
		void SendMessage(char* name, IterList* args);
		void Scheduler();
		void Start();
		
		MsgList* msgList;
		void* replyTo;
		Lock* msgLock;
		Thread* myThread;
		char* myName;
		Condition* sleepCon;
		
		Line* myLine;
		bool onBreak;
		//Possible statuses for TicketTaker: {Idle, WaitingForCust,  SentToTheater, TalkingToManager, OnBreak}
		std::string status;
		int SizeOfGroupNotInTheater;
		bool CallNextInLine();
		void AcceptTickets(void* custPtr,void* ticketPtr, int size);
		void SendInPerson();
		void TellTechImIdle(void* techPtr);
		void TellStatus(void* mngrPtr);
		void ContinueOn();
		void GoOnBreak();
		void ComeOffBreak();
		
};


#endif
